package shiro;

import com.alibaba.fastjson.JSON;
import com.tc.shiro.entity.PortalMenu;
import com.tc.shiro.repository.PortalMenuRepository;
import com.tc.shiro.repository.PortalOperatorRepository;
import com.tc.shiro.test.InsertUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@Slf4j
public class testShiro1 {
    @Autowired
    private PortalMenuRepository rortalMenuRepository;

    @Autowired
    private PortalOperatorRepository portalOperatorRepo;

    @Test
    public void demo(){
        List<PortalMenu> portalMenus = rortalMenuRepository.selectAllMenu();
        log.info(JSON.toJSONString(portalMenus));
    }

    @Test
    public void demo1(){
        int i = portalOperatorRepo.insertSelective(InsertUser.init());
        log.info(String.valueOf(i));
    }

}
